****************************************Descriptive Statistics**********************************************

************************************** Table 1, Panel A: DMA–Level Characteristics *************************************
clear all

*import DMA demographics data 
import delimited "dma_demographics.csv"

label variable lottery_pc "Lottery sales per capita"
label variable med_income "Median income ($ thousands)"
label variable population "Population (thousands)"
label variable inc_ineq "Income inequality"
label variable minority_ratio "Minority ratio"
label variable non_college "Non-college ratio"
label variable rural_urban "Rural score"
label variable male_ratio "Male ratio"
label variable majority_male "Majority male (0/1)"
label variable cathprt "Catholic/Protestant ratio"
label variable broadband "Broadband access rate"
label variable median_age "Median age"
label variable under_25 "Fraction < 25 years old"
label variable married "Married ratio"
label variable unemp "Unemployment rate"
label variable cfpb_complaints "CFPB complaints (per 1000)"
label variable lib_vote_share "Libertarian Party vote share"
label variable risk_taking "Regional risk-taking preferences"
label variable crypto_ads_spending "Advertisement spending ($ per 1000 population)"

*report summary statistics
est clear
estpost tabstat lottery_pc med_income population inc_ineq minority_ratio non_college rural_urban male_ratio majority_male cathprt broadband median_age under_25 married unemp cfpb_complaints lib_vote_share risk_taking crypto_ads_spending, stats(count mean p50 sd min max) col(stat)



************************************** Table 1, Panel B: ICO–Level Characteristics *************************************
clear all

*import ICO level data 
import delimited "C:\Users\ndp65991\Dropbox\ICO_gambling\jfqa_submission\data\ico_outcome_regressions.csv"

gen raised_usd_thousands = raised_usd/1000

label variable retention "Token retention (%)"
label variable kyc "KYC (0/1)"
label variable accelerated_pricing "Accelerated pricing (0/1)"
label variable platform "Platform (0/1)"
label variable pre_sale_dummy "Pre-sale (0/1)"
label variable white_paper_dummy "White paper (0/1)"
label variable github_dummy "GitHub presence (0/1)"
label variable team_dummy "Team disclosure (0/1)"
label variable raised_usd_thousands "Funds raised ($ thousands)"
label variable log_raised  "Funds raised (log)"
label variable relative_raised  "Funds raised (frac. of hardcap)"
label variable contributors  "# Contributors"
label variable svi_raw "ICO SVI"



*report summary statistics
est clear
estpost tabstat retention kyc accelerated_pricing platform pre_sale_dummy white_paper_dummy github_dummy team_dummy raised_usd_thousands log_raised relative_raised contributors svi_raw, stats(count mean p50 sd min max) col(stat)



******************************* Supplement statistics: ICO-DMA level *****************************************
clear all
*import ICO-DMA level data 
import delimited "C:\Users\ndp65991\Dropbox\ICO_gambling\jfqa_submission\data\ico_dma_regressions.csv"


*only keep DMAs with non-zero lottery sales
keep if no_lottery != 1

*only keep DMAs with non-zero ICO attention
keep if ico_dma_svi > 0

*label variable names
label variable ico_dma_svi "ICO–DMA SVI "
label variable wallet_svi "ICO Wallet–DMA SVI"

*report summary statistics
est clear
estpost tabstat ico_dma_svi wallet_svi, stats(count mean p50 sd min max) col(stat)





************************************** Table 1, Panel C: NFT–Level Characteristics *************************************
clear all

*import ICO level data 
import delimited "C:\Users\ndp65991\Dropbox\ICO_gambling\jfqa_submission\data\nft_outcome_regressions.csv"

label variable total_supply "Total token supply"
label variable rare_items "Advertises rare items (0/1)"
label variable has_twitter "Has Twitter presence (0/1)"
label variable has_discord "Has Discord presence (0/1)"
label variable royalty_fee "Creator's royalty fee (pp)"
label variable log_fund_raised  "Log funds raised (ETH)"
label variable days_mint99 "Days to mint 99%"
label variable mint_wallets "# Minting wallets"
label variable nft_svi "NFT collection SVI"



*report summary statistics
est clear
estpost tabstat total_supply rare_items has_twitter has_discord royalty_fee log_fund_raised days_mint99 mint_wallets nft_svi, stats(count mean p50 sd min max) col(stat)



******************************* Supplement statistics: NFT-DMA level *****************************************

clear all
*import NFT-DMA level data 
import delimited "C:\Users\ndp65991\Dropbox\ICO_gambling\jfqa_submission\data\nft_dma_regressions.csv"




*only keep DMAs with state lottery - non-zero lottery sales
keep if no_lottery != 1 

*only keep non-zero mint price NFT collections
keep if med_mint_price > 0

*remove nft collections with over 10,000 items
keep if total_supply <= 10000

*keep only positive SVI
keep if nft_dma_svi > 0


*generate regression sample by removing NFTs with positive attention from only 1 DMA (for consistent sample size with and without NFT collection fixed effects)
eststo temp: reghdfe nft_dma_svi lot_sale_std pop_std broadband_std, absorb(nft_id) vce(cluster nft_id dma_id)
gen nft_fe_sample = e(sample)
keep if nft_fe_sample == 1

*label variable names
label variable nft_dma_svi "NFT–DMA SVI "
label variable wallet_svi "NFT Wallet–DMA SVI"

*report summary statistics
est clear
estpost tabstat nft_dma_svi wallet_svi, stats(count mean p50 sd min max) col(stat)

